home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / QD3D.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  38.6 KB  |  1,246 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QD3D.a
  3. ;
  4. ;    Contains:    Base types for Quickdraw 3D                            
  5. ;
  6. ;    Version:    Technology:    Quickdraw 3D 1.5.1
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1995-1997 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
  19. __QD3D__ SET 1
  20.  
  21.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  22.     include 'ConditionalMacros.a'
  23.     ENDIF
  24.  
  25.     IF TARGET_OS_MAC THEN
  26.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  27.     include 'Types.a'
  28.     ENDIF
  29.     ENDIF    ; TARGET_OS_MAC
  30.     IF TARGET_OS_MAC THEN
  31.     OS_MACINTOSH: SET 1
  32.     OS_WIN32: SET 0
  33.     OS_UNIX: SET 0
  34.     OS_NEXT: SET 0
  35.     WINDOW_SYSTEM_MACINTOSH: SET 1
  36.     WINDOW_SYSTEM_WIN32: SET 0
  37.     WINDOW_SYSTEM_X11: SET 0
  38.     WINDOW_SYSTEM_NEXT: SET 0
  39.     ENDIF    ; TARGET_OS_MAC
  40.     IF TARGET_OS_WIN32 THEN
  41.     OS_MACINTOSH: SET 0
  42.     OS_WIN32: SET 1
  43.     OS_UNIX: SET 0
  44.     OS_NEXT: SET 0
  45.     WINDOW_SYSTEM_MACINTOSH: SET 0
  46.     WINDOW_SYSTEM_WIN32: SET 1
  47.     WINDOW_SYSTEM_X11: SET 0
  48.     WINDOW_SYSTEM_NEXT: SET 0
  49.     ENDIF    ; TARGET_OS_WIN32
  50.  
  51. ; ******************************************************************************
  52. ; **                                                                             **
  53. ; **                                NULL definition                                 **
  54. ; **                                                                             **
  55. ; ****************************************************************************
  56.  
  57. ; ******************************************************************************
  58. ; **                                                                             **
  59. ; **                                    Objects                                     **
  60. ; **                                                                             **
  61. ; ****************************************************************************
  62.  
  63. ; * Everything in QuickDraw 3D is an OBJECT: a bunch of data with a type,
  64. ; * deletion, duplication, and i/o methods.
  65.  
  66.     IF TARGET_OS_MAC THEN
  67. ; typedef FourCharCode                     TQ3ObjectType
  68.  
  69.     ELSE
  70. ; typedef long                             TQ3ObjectType
  71.  
  72.     ENDIF    ; TARGET_OS_MAC
  73.  
  74.  
  75. ; * There are four subclasses of OBJECT:
  76. ; *    an ELEMENT, which is data that is placed in a SET
  77. ; *    a SHAREDOBJECT, which is reference-counted data that is shared
  78. ; *    VIEWs, which maintain state information for an image
  79. ; *    a PICK, which used to query a VIEW
  80.  
  81. ; typedef TQ3Object                     TQ3ElementObject
  82.  
  83. ; typedef TQ3Object                     TQ3SharedObject
  84.  
  85. ; typedef TQ3Object                     TQ3ViewObject
  86.  
  87. ; typedef TQ3Object                     TQ3PickObject
  88.  
  89. ; * There are several types of SharedObjects:
  90. ; *    RENDERERs, which paint to a drawContext
  91. ; *    DRAWCONTEXTs, which are an interface to a device 
  92. ; *    SETs, which maintains "mathematical sets" of ELEMENTs
  93. ; *    FILEs, which maintain state information for a metafile
  94. ; *    SHAPEs, which affect the state of the View
  95. ; *    SHAPEPARTs, which contain geometry-specific data about a picking hit
  96. ; *    CONTROLLERSTATEs, which hold state of the output channels for a CONTROLLER
  97. ; *    TRACKERs, which represent a position and orientation in the user interface
  98. ; *  STRINGs, which are abstractions of text string data.
  99. ; *    STORAGE, which is an abstraction for stream-based data storage (files, memory)
  100. ; *    TEXTUREs, for sharing bitmap information for TEXTURESHADERS
  101. ; *    VIEWHINTs, which specifies viewing preferences in FILEs
  102.  
  103. ; typedef TQ3SharedObject                 TQ3RendererObject
  104.  
  105. ; typedef TQ3SharedObject                 TQ3DrawContextObject
  106.  
  107. ; typedef TQ3SharedObject                 TQ3SetObject
  108.  
  109. ; typedef TQ3SharedObject                 TQ3FileObject
  110.  
  111. ; typedef TQ3SharedObject                 TQ3ShapeObject
  112.  
  113. ; typedef TQ3SharedObject                 TQ3ShapePartObject
  114.  
  115. ; typedef TQ3SharedObject                 TQ3ControllerStateObject
  116.  
  117. ; typedef TQ3SharedObject                 TQ3TrackerObject
  118.  
  119. ; typedef TQ3SharedObject                 TQ3StringObject
  120.  
  121. ; typedef TQ3SharedObject                 TQ3StorageObject
  122.  
  123. ; typedef TQ3SharedObject                 TQ3TextureObject
  124.  
  125. ; typedef TQ3SharedObject                 TQ3ViewHintsObject
  126.  
  127. ; * There is one types of SET:
  128. ; *    ATTRIBUTESETs, which contain ATTRIBUTEs which are inherited 
  129.  
  130. ; typedef TQ3SetObject                     TQ3AttributeSet
  131.  
  132. ; * There are many types of SHAPEs:
  133. ; *    LIGHTs, which affect how the RENDERER draws 3-D cues
  134. ; *    CAMERAs, which affects the location and orientation of the RENDERER in space
  135. ; *    GROUPs, which may contain any number of SHARED OBJECTS
  136. ; *    GEOMETRYs, which are representations of three-dimensional data
  137. ; *    SHADERs, which affect how colors are drawn on a geometry
  138. ; *    STYLEs, which affect how the RENDERER paints to the DRAWCONTEXT
  139. ; *    TRANSFORMs, which affect the coordinate system in the VIEW
  140. ; *    REFERENCEs, which are references to objects in FILEs
  141. ; *  UNKNOWN, which hold unknown objects read from a metafile.
  142.  
  143. ; typedef TQ3ShapeObject                 TQ3GroupObject
  144.  
  145. ; typedef TQ3ShapeObject                 TQ3GeometryObject
  146.  
  147. ; typedef TQ3ShapeObject                 TQ3ShaderObject
  148.  
  149. ; typedef TQ3ShapeObject                 TQ3StyleObject
  150.  
  151. ; typedef TQ3ShapeObject                 TQ3TransformObject
  152.  
  153. ; typedef TQ3ShapeObject                 TQ3LightObject
  154.  
  155. ; typedef TQ3ShapeObject                 TQ3CameraObject
  156.  
  157. ; typedef TQ3ShapeObject                 TQ3UnknownObject
  158.  
  159. ; typedef TQ3ShapeObject                 TQ3ReferenceObject
  160.  
  161. ; * For now, there is only one type of SHAPEPARTs:
  162. ; *    MESHPARTs, which describe some part of a mesh
  163.  
  164. ; typedef TQ3ShapePartObject             TQ3MeshPartObject
  165.  
  166. ; * There are three types of MESHPARTs:
  167. ; *    MESHFACEPARTs, which describe a face of a mesh
  168. ; *    MESHEDGEPARTs, which describe a edge of a mesh
  169. ; *    MESHVERTEXPARTs, which describe a vertex of a mesh
  170.  
  171. ; typedef TQ3MeshPartObject             TQ3MeshFacePartObject
  172.  
  173. ; typedef TQ3MeshPartObject             TQ3MeshEdgePartObject
  174.  
  175. ; typedef TQ3MeshPartObject             TQ3MeshVertexPartObject
  176.  
  177. ; * A DISPLAY Group can be drawn to a view
  178.  
  179. ; typedef TQ3GroupObject                 TQ3DisplayGroupObject
  180.  
  181. ; * There are many types of SHADERs:
  182. ; *    SURFACESHADERs, which affect how the surface of a geometry is painted
  183. ; *    ILLUMINATIONSHADERs, which affect how lights affect the color of a surface
  184.  
  185. ; typedef TQ3ShaderObject                 TQ3SurfaceShaderObject
  186.  
  187. ; typedef TQ3ShaderObject                 TQ3IlluminationShaderObject
  188.  
  189. ; * A handle to an object in a group
  190.  
  191.  
  192.  
  193. ;  
  194. ; * TQ3ObjectClassNameString is used for the class name of an object
  195.  
  196.  
  197. kQ3StringMaximumLength            EQU        1024
  198. TQ3ObjectClassNameString RECORD 0
  199. elements                 ds.b    1024
  200. sizeof                     EQU *                    ; size:   $400 (1024)
  201.                         ENDR
  202.  
  203.  
  204. ; ******************************************************************************
  205. ; **                                                                             **
  206. ; **                            Client/Server Things                             **
  207. ; **                                                                             **
  208. ; ****************************************************************************
  209.  
  210. ; typedef void *                        TQ3ControllerRef
  211.  
  212. ; ******************************************************************************
  213. ; **                                                                             **
  214. ; **                            Flags and Switches                                 **
  215. ; **                                                                             **
  216. ; ****************************************************************************
  217.  
  218.  
  219. ; typedef long                            TQ3Boolean
  220. kQ3False                        EQU        0
  221. kQ3True                            EQU        1
  222.  
  223. ; typedef long                            TQ3Switch
  224. kQ3Off                            EQU        0
  225. kQ3On                            EQU        1
  226.  
  227. ; typedef long                            TQ3Status
  228. kQ3Failure                        EQU        0
  229. kQ3Success                        EQU        1
  230.  
  231. ; typedef long                            TQ3Axis
  232. kQ3AxisX                        EQU        0
  233. kQ3AxisY                        EQU        1
  234. kQ3AxisZ                        EQU        2
  235.  
  236. ; typedef long                            TQ3PixelType
  237. kQ3PixelTypeRGB32                EQU        0                    ; Alpha:8 (ignored), R:8, G:8, B:8    
  238. kQ3PixelTypeARGB32                EQU        1                    ; Alpha:8, R:8, G:8, B:8             
  239. kQ3PixelTypeRGB16                EQU        2                    ; Alpha:1 (ignored), R:5, G:5, B:5    
  240. kQ3PixelTypeARGB16                EQU        3                    ; Alpha:1, R:5, G:5, B:5             
  241. kQ3PixelTypeRGB16_565            EQU        4                    ; Win32 only: 16 bits/pixel, R:5, G:6, B:5        
  242. kQ3PixelTypeRGB24                EQU        5                    ; Win32 only: 24 bits/pixel, R:8, G:8, B:8        
  243.  
  244. ; typedef long                            TQ3Endian
  245. kQ3EndianBig                    EQU        0
  246. kQ3EndianLittle                    EQU        1
  247.  
  248. ; typedef long                            TQ3EndCapMasks
  249. kQ3EndCapNone                    EQU        0
  250. kQ3EndCapMaskTop                EQU        $01
  251. kQ3EndCapMaskBottom                EQU        $02
  252. kQ3EndCapMaskInterior            EQU        $04
  253. ; typedef unsigned long                 TQ3EndCap
  254.  
  255.  
  256. kQ3ArrayIndexNULL                EQU        -1
  257. ; ******************************************************************************
  258. ; **                                                                             **
  259. ; **                        Point and Vector Definitions                         **
  260. ; **                                                                             **
  261. ; ****************************************************************************
  262.  
  263. TQ3Vector2D                RECORD 0
  264. x                         ds        Float32            ; offset: $0 (0)
  265. y                         ds        Float32            ; offset: $4 (4)
  266. sizeof                     EQU *                    ; size:   $8 (8)
  267.                         ENDR
  268. TQ3Vector3D                RECORD 0
  269. x                         ds        Float32            ; offset: $0 (0)
  270. y                         ds        Float32            ; offset: $4 (4)
  271. z                         ds        Float32            ; offset: $8 (8)
  272. sizeof                     EQU *                    ; size:   $C (12)
  273.                         ENDR
  274. TQ3Point2D                RECORD 0
  275. x                         ds        Float32            ; offset: $0 (0)
  276. y                         ds        Float32            ; offset: $4 (4)
  277. sizeof                     EQU *                    ; size:   $8 (8)
  278.                         ENDR
  279. TQ3Point3D                RECORD 0
  280. x                         ds        Float32            ; offset: $0 (0)
  281. y                         ds        Float32            ; offset: $4 (4)
  282. z                         ds        Float32            ; offset: $8 (8)
  283. sizeof                     EQU *                    ; size:   $C (12)
  284.                         ENDR
  285. TQ3RationalPoint4D        RECORD 0
  286. x                         ds        Float32            ; offset: $0 (0)
  287. y                         ds        Float32            ; offset: $4 (4)
  288. z                         ds        Float32            ; offset: $8 (8)
  289. w                         ds        Float32            ; offset: $C (12)
  290. sizeof                     EQU *                    ; size:   $10 (16)
  291.                         ENDR
  292. TQ3RationalPoint3D        RECORD 0
  293. x                         ds        Float32            ; offset: $0 (0)
  294. y                         ds        Float32            ; offset: $4 (4)
  295. w                         ds        Float32            ; offset: $8 (8)
  296. sizeof                     EQU *                    ; size:   $C (12)
  297.                         ENDR
  298. ; ******************************************************************************
  299. ; **                                                                             **
  300. ; **                                Quaternion                                     **
  301. ; **                                                                             **
  302. ; ****************************************************************************
  303.  
  304. TQ3Quaternion            RECORD 0
  305. w                         ds        Float32            ; offset: $0 (0)
  306. x                         ds        Float32            ; offset: $4 (4)
  307. y                         ds        Float32            ; offset: $8 (8)
  308. z                         ds        Float32            ; offset: $C (12)
  309. sizeof                     EQU *                    ; size:   $10 (16)
  310.                         ENDR
  311. ; ******************************************************************************
  312. ; **                                                                             **
  313. ; **                                Ray Definition                                 **
  314. ; **                                                                             **
  315. ; ****************************************************************************
  316.  
  317. TQ3Ray3D                RECORD 0
  318. origin                     ds        TQ3Point3D        ; offset: $0 (0)
  319. direction                 ds        TQ3Vector3D        ; offset: $C (12)
  320. sizeof                     EQU *                    ; size:   $18 (24)
  321.                         ENDR
  322. ; ******************************************************************************
  323. ; **                                                                             **
  324. ; **                        Parameterization Data Structures                     **
  325. ; **                                                                             **
  326. ; ****************************************************************************
  327.  
  328. TQ3Param2D                RECORD 0
  329. u                         ds        Float32            ; offset: $0 (0)
  330. v                         ds        Float32            ; offset: $4 (4)
  331. sizeof                     EQU *                    ; size:   $8 (8)
  332.                         ENDR
  333. TQ3Param3D                RECORD 0
  334. u                         ds        Float32            ; offset: $0 (0)
  335. v                         ds        Float32            ; offset: $4 (4)
  336. w                         ds        Float32            ; offset: $8 (8)
  337. sizeof                     EQU *                    ; size:   $C (12)
  338.                         ENDR
  339. TQ3Tangent2D            RECORD 0
  340. uTangent                 ds        TQ3Vector3D        ; offset: $0 (0)
  341. vTangent                 ds        TQ3Vector3D        ; offset: $C (12)
  342. sizeof                     EQU *                    ; size:   $18 (24)
  343.                         ENDR
  344. TQ3Tangent3D            RECORD 0
  345. uTangent                 ds        TQ3Vector3D        ; offset: $0 (0)
  346. vTangent                 ds        TQ3Vector3D        ; offset: $C (12)
  347. wTangent                 ds        TQ3Vector3D        ; offset: $18 (24)
  348. sizeof                     EQU *                    ; size:   $24 (36)
  349.                         ENDR
  350. ; ******************************************************************************
  351. ; **                                                                             **
  352. ; **                        Polar and Spherical Coordinates                         **
  353. ; **                                                                             **
  354. ; ****************************************************************************
  355.  
  356. TQ3PolarPoint            RECORD 0
  357. r                         ds        Float32            ; offset: $0 (0)
  358. theta                     ds        Float32            ; offset: $4 (4)
  359. sizeof                     EQU *                    ; size:   $8 (8)
  360.                         ENDR
  361. TQ3SphericalPoint        RECORD 0
  362. rho                         ds        Float32            ; offset: $0 (0)
  363. theta                     ds        Float32            ; offset: $4 (4)
  364. phi                         ds        Float32            ; offset: $8 (8)
  365. sizeof                     EQU *                    ; size:   $C (12)
  366.                         ENDR
  367. ; ******************************************************************************
  368. ; **                                                                             **
  369. ; **                            Color Definition                                 **
  370. ; **                                                                             **
  371. ; ****************************************************************************
  372.  
  373. TQ3ColorRGB                RECORD 0
  374. r                         ds        Float32            ; offset: $0 (0)
  375. g                         ds        Float32            ; offset: $4 (4)
  376. b                         ds        Float32            ; offset: $8 (8)
  377. sizeof                     EQU *                    ; size:   $C (12)
  378.                         ENDR
  379. TQ3ColorARGB            RECORD 0
  380. a                         ds        Float32            ; offset: $0 (0)
  381. r                         ds        Float32            ; offset: $4 (4)
  382. g                         ds        Float32            ; offset: $8 (8)
  383. b                         ds        Float32            ; offset: $C (12)
  384. sizeof                     EQU *                    ; size:   $10 (16)
  385.                         ENDR
  386. ; ******************************************************************************
  387. ; **                                                                             **
  388. ; **                                    Vertices                                 **
  389. ; **                                                                             **
  390. ; ****************************************************************************
  391.  
  392. TQ3Vertex3D                RECORD 0
  393. point                     ds        TQ3Point3D        ; offset: $0 (0)
  394. attributeSet             ds.l    1                ; offset: $C (12)
  395. sizeof                     EQU *                    ; size:   $10 (16)
  396.                         ENDR
  397. ; ******************************************************************************
  398. ; **                                                                             **
  399. ; **                                    Matrices                                 **
  400. ; **                                                                             **
  401. ; ****************************************************************************
  402.  
  403. TQ3Matrix3x3            RECORD 0
  404. value                     ds.b    3 * 3 * Float32.sizeof ; offset: $0 (0)
  405. sizeof                     EQU *                    ; size:   $24 (36)
  406.                         ENDR
  407. TQ3Matrix4x4            RECORD 0
  408. value                     ds.b    4 * 4 * Float32.sizeof ; offset: $0 (0)
  409. sizeof                     EQU *                    ; size:   $40 (64)
  410.                         ENDR
  411. ; ******************************************************************************
  412. ; **                                                                             **
  413. ; **                                Bitmap/Pixmap                                 **
  414. ; **                                                                             **
  415. ; ****************************************************************************
  416.  
  417. TQ3Pixmap                RECORD 0
  418. image                     ds.l    1                ; offset: $0 (0)
  419. width                     ds.l    1                ; offset: $4 (4)
  420. height                     ds.l    1                ; offset: $8 (8)
  421. rowBytes                 ds.l    1                ; offset: $C (12)
  422. pixelSize                 ds.l    1                ; offset: $10 (16)        ;  MUST be 16 or 32 to use with the    Interactive Renderer on Mac OS
  423. pixelType                 ds.l    1                ; offset: $14 (20)
  424. bitOrder                 ds.l    1                ; offset: $18 (24)
  425. byteOrder                 ds.l    1                ; offset: $1C (28)
  426. sizeof                     EQU *                    ; size:   $20 (32)
  427.                         ENDR
  428. TQ3StoragePixmap        RECORD 0
  429. image                     ds.l    1                ; offset: $0 (0)
  430. width                     ds.l    1                ; offset: $4 (4)
  431. height                     ds.l    1                ; offset: $8 (8)
  432. rowBytes                 ds.l    1                ; offset: $C (12)
  433. pixelSize                 ds.l    1                ; offset: $10 (16)        ;  MUST be 16 or 32 to use with the    Interactive Renderer on Mac OS
  434. pixelType                 ds.l    1                ; offset: $14 (20)
  435. bitOrder                 ds.l    1                ; offset: $18 (24)
  436. byteOrder                 ds.l    1                ; offset: $1C (28)
  437. sizeof                     EQU *                    ; size:   $20 (32)
  438.                         ENDR
  439. TQ3Bitmap                RECORD 0
  440. image                     ds.l    1                ; offset: $0 (0)
  441. width                     ds.l    1                ; offset: $4 (4)
  442. height                     ds.l    1                ; offset: $8 (8)
  443. rowBytes                 ds.l    1                ; offset: $C (12)
  444. bitOrder                 ds.l    1                ; offset: $10 (16)
  445. sizeof                     EQU *                    ; size:   $14 (20)
  446.                         ENDR
  447. TQ3MipmapImage            RECORD 0
  448. ;  An image for use as a texture mipmap  
  449. width                     ds.l    1                ; offset: $0 (0)        ;  Width of mipmap, must be power of 2   
  450. height                     ds.l    1                ; offset: $4 (4)        ;  Height of mipmap, must be power of 2  
  451. rowBytes                 ds.l    1                ; offset: $8 (8)        ;  Rowbytes of mipmap                    
  452. offset                     ds.l    1                ; offset: $C (12)        ;  Offset from image base to this mipmap 
  453. sizeof                     EQU *                    ; size:   $10 (16)
  454.                         ENDR
  455. TQ3Mipmap                RECORD 0
  456. image                     ds.l    1                ; offset: $0 (0)        ;  Data containing the texture map and     
  457. ;  if (useMipmapping==kQ3True) the         
  458. ;  mipmap data                             
  459. useMipmapping             ds.l    1                ; offset: $4 (4)        ;  True if mipmapping should be used     
  460. ;  and all mipmaps have been provided   
  461. pixelType                 ds.l    1                ; offset: $8 (8)
  462. bitOrder                 ds.l    1                ; offset: $C (12)
  463. byteOrder                 ds.l    1                ; offset: $10 (16)
  464. reserved                 ds.l    1                ; offset: $14 (20)        ;  leave NULL for next version 
  465. mipmaps                     ds.b    32 * TQ3MipmapImage.sizeof ; offset: $18 (24) ;  The actual number of mipmaps is         
  466. ;  determined from the size of the         
  467. ;  first mipmap                            
  468. sizeof                     EQU *                    ; size:   $218 (536)
  469.                         ENDR
  470. ;
  471. ; extern TQ3Status Q3Bitmap_Empty(TQ3Bitmap *bitmap)
  472. ;
  473.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  474.         IMPORT_CFM_FUNCTION Q3Bitmap_Empty
  475.     ENDIF
  476.  
  477. ;
  478. ; extern unsigned long Q3Bitmap_GetImageSize(unsigned long width, unsigned long height)
  479. ;
  480.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  481.         IMPORT_CFM_FUNCTION Q3Bitmap_GetImageSize
  482.     ENDIF
  483.  
  484.  
  485. ; ******************************************************************************
  486. ; **                                                                             **
  487. ; **                        Higher dimension quantities                             **
  488. ; **                                                                             **
  489. ; ****************************************************************************
  490.  
  491. TQ3Area                    RECORD 0
  492. min                         ds        TQ3Point2D        ; offset: $0 (0)
  493. max                         ds        TQ3Point2D        ; offset: $8 (8)
  494. sizeof                     EQU *                    ; size:   $10 (16)
  495.                         ENDR
  496. TQ3PlaneEquation        RECORD 0
  497. normal                     ds        TQ3Vector3D        ; offset: $0 (0)
  498. constant                 ds        Float32            ; offset: $C (12)
  499. sizeof                     EQU *                    ; size:   $10 (16)
  500.                         ENDR
  501. TQ3BoundingBox            RECORD 0
  502. min                         ds        TQ3Point3D        ; offset: $0 (0)
  503. max                         ds        TQ3Point3D        ; offset: $C (12)
  504. isEmpty                     ds.l    1                ; offset: $18 (24)
  505. sizeof                     EQU *                    ; size:   $1C (28)
  506.                         ENDR
  507. TQ3BoundingSphere        RECORD 0
  508. origin                     ds        TQ3Point3D        ; offset: $0 (0)
  509. radius                     ds        Float32            ; offset: $C (12)
  510. isEmpty                     ds.l    1                ; offset: $10 (16)
  511. sizeof                     EQU *                    ; size:   $14 (20)
  512.                         ENDR
  513. ; *    The TQ3ComputeBounds flag passed to StartBoundingBox or StartBoundingSphere
  514. ; *    calls in the View. It's a hint to the system as to how it should 
  515. ; *    compute the bbox of a shape:
  516. ; *
  517. ; *    kQ3ComputeBoundsExact:    
  518. ; *        Vertices of shapes are transformed into world space and
  519. ; *        the world space bounding box is computed from them.  Slow!
  520. ; *    
  521. ; *    kQ3ComputeBoundsApproximate: 
  522. ; *        A local space bounding box is computed from a shape's
  523. ; *        vertices.  This bbox is then transformed into world space,
  524. ; *        and its bounding box is taken as the shape's approximate
  525. ; *        bbox.  Fast but the bbox is larger than optimal.
  526.  
  527.  
  528. ; typedef long                            TQ3ComputeBounds
  529. kQ3ComputeBoundsExact            EQU        0
  530. kQ3ComputeBoundsApproximate        EQU        1
  531.  
  532. ; ******************************************************************************
  533. ; **                                                                             **
  534. ; **                            Object System Types                                 **
  535. ; **                                                                             **
  536. ; ****************************************************************************
  537.  
  538.  
  539.  
  540. ; typedef unsigned long                 TQ3MethodType
  541.  
  542. ; * Object methods
  543.  
  544. ; * IO Methods
  545.  
  546. ; * MetaHandler:
  547. ; *        When you give a metahandler to QuickDraw 3D, it is called multiple times to
  548. ; *        build method tables, and then is thrown away. You are guaranteed that
  549. ; *        your metahandler will never be called again after a call that was passed
  550. ; *        a metahandler returns.
  551. ; *
  552. ; *        Your metahandler should contain a switch on the methodType passed to it
  553. ; *        and should return the corresponding method as an TQ3FunctionPointer.
  554. ; *
  555. ; *        IMPORTANT: A metaHandler MUST always "return" a value. If you are
  556. ; *        passed a methodType that you do not understand, ALWAYS return NULL.
  557. ; *
  558. ; *        These types here are prototypes of how your functions should look.
  559.  
  560.  
  561.  
  562. ; typedef unsigned long                 TQ3XMethodType
  563.  
  564. ; * Object methods
  565.  
  566. ; * MetaHandler:
  567. ; *        When you give a metahandler to QuickDraw 3D, it is called multiple 
  568. ; *        times to build method tables, and then is thrown away. You are 
  569. ; *        guaranteed that your metahandler will never be called again after a 
  570. ; *        call that was passed a metahandler returns.
  571. ; *
  572. ; *        Your metahandler should contain a switch on the methodType passed to it
  573. ; *        and should return the corresponding method as an TQ3XFunctionPointer.
  574. ; *
  575. ; *        IMPORTANT: A metaHandler MUST always "return" a value. If you are
  576. ; *        passed a methodType that you do not understand, ALWAYS return NULL.
  577. ; *
  578. ; *        These types here are prototypes of how your functions should look.
  579.  
  580. ; * See QD3DIO.h for the IO method types: 
  581. ; *        ObjectReadData, ObjectTraverse, ObjectWrite
  582.  
  583.  
  584. ; ******************************************************************************
  585. ; **                                                                             **
  586. ; **                                Set Types                                     **
  587. ; **                                                                             **
  588. ; ****************************************************************************
  589.  
  590. ; typedef long                             TQ3ElementType
  591.  
  592.  
  593. kQ3ElementTypeNone                EQU        0
  594. kQ3ElementTypeUnknown            EQU        32
  595. kQ3ElementTypeSet                EQU        33
  596. ;  
  597. ; *    kQ3ElementTypeUnknown is a TQ3Object. 
  598. ; *    
  599. ; *        Do Q3Set_Add(s, ..., &obj) or Q3Set_Get(s, ..., &obj);
  600. ; *        
  601. ; *        Note that the object is always referenced when copying around. 
  602. ; *        
  603. ; *        Generally, it is an Unknown object, a Group of Unknown objects, or a 
  604. ; *        group of other "objects" which have been found in the metafile and
  605. ; *        have no attachment method to their parent. Be prepared to handle
  606. ; *        any or all of these cases if you actually access the set on a shape.
  607. ; *
  608. ; *    kQ3ElementTypeSet is a TQ3SetObject. 
  609. ; *    
  610. ; *        Q3Shape_GetSet(s,&o) is eqivalent to 
  611. ; *            Q3Shape_GetElement(s, kQ3ElementTypeSet, &o)
  612. ; *            
  613. ; *        Q3Shape_SetSet(s,o)  is eqivalent to 
  614. ; *            Q3Shape_SetElement(s, kQ3ElementTypeSet, &o)
  615. ; *    
  616. ; *        Note that the object is always referenced when copying around. 
  617. ; *        
  618. ; *    See the note below about the Set and Shape changes.
  619.  
  620.  
  621. ; ******************************************************************************
  622. ; **                                                                             **
  623. ; **                            Object System Macros                             **
  624. ; **                                                                             **
  625. ; ****************************************************************************
  626.  
  627. ; ******************************************************************************
  628. ; **                                                                             **
  629. ; **                                Object Types                                 **
  630. ; **                                                                             **
  631. ; ****************************************************************************
  632.  
  633. ; * Note:    a call to Q3Foo_GetType will return a value kQ3FooTypeBar
  634. ; *            e.g. Q3Shared_GetType(object) returns kQ3SharedTypeShape, etc.
  635.  
  636.  
  637. kQ3ObjectTypeInvalid            EQU        0
  638. kQ3ObjectTypeView                EQU        'view'
  639. kQ3ObjectTypeElement            EQU        'elmn'
  640. kQ3ElementTypeAttribute            EQU        'eatt'
  641. kQ3ObjectTypePick                EQU        'pick'
  642. kQ3PickTypeWindowPoint            EQU        'pkwp'
  643. kQ3PickTypeWindowRect            EQU        'pkwr'
  644. kQ3ObjectTypeShared                EQU        'shrd'
  645. kQ3SharedTypeRenderer            EQU        'rddr'
  646. kQ3RendererTypeWireFrame        EQU        'wrfr'
  647. kQ3RendererTypeGeneric            EQU        'gnrr'
  648. kQ3RendererTypeInteractive        EQU        'ctwn'
  649. kQ3SharedTypeShape                EQU        'shap'
  650. kQ3ShapeTypeGeometry            EQU        'gmtr'
  651. kQ3GeometryTypeBox                EQU        'box '
  652. kQ3GeometryTypeGeneralPolygon    EQU        'gpgn'
  653. kQ3GeometryTypeLine                EQU        'line'
  654. kQ3GeometryTypeMarker            EQU        'mrkr'
  655. kQ3GeometryTypePixmapMarker        EQU        'mrkp'
  656. kQ3GeometryTypeMesh                EQU        'mesh'
  657. kQ3GeometryTypeNURBCurve        EQU        'nrbc'
  658. kQ3GeometryTypeNURBPatch        EQU        'nrbp'
  659. kQ3GeometryTypePoint            EQU        'pnt '
  660. kQ3GeometryTypePolygon            EQU        'plyg'
  661. kQ3GeometryTypePolyLine            EQU        'plyl'
  662. kQ3GeometryTypeTriangle            EQU        'trng'
  663. kQ3GeometryTypeTriGrid            EQU        'trig'
  664. kQ3GeometryTypeCone                EQU        'cone'
  665. kQ3GeometryTypeCylinder            EQU        'cyln'
  666. kQ3GeometryTypeDisk                EQU        'disk'
  667. kQ3GeometryTypeEllipse            EQU        'elps'
  668. kQ3GeometryTypeEllipsoid        EQU        'elpd'
  669. kQ3GeometryTypePolyhedron        EQU        'plhd'
  670. kQ3GeometryTypeTorus            EQU        'tors'
  671. kQ3GeometryTypeTriMesh            EQU        'tmsh'
  672. kQ3ShapeTypeShader                EQU        'shdr'
  673. kQ3ShaderTypeSurface            EQU        'sush'
  674. kQ3SurfaceShaderTypeTexture        EQU        'txsu'
  675. kQ3ShaderTypeIllumination        EQU        'ilsh'
  676. kQ3IlluminationTypePhong        EQU        'phil'
  677. kQ3IlluminationTypeLambert        EQU        'lmil'
  678. kQ3IlluminationTypeNULL            EQU        'nuil'
  679. kQ3ShapeTypeStyle                EQU        'styl'
  680. kQ3StyleTypeBackfacing            EQU        'bckf'
  681. kQ3StyleTypeInterpolation        EQU        'intp'
  682. kQ3StyleTypeFill                EQU        'fist'
  683. kQ3StyleTypePickID                EQU        'pkid'
  684. kQ3StyleTypeReceiveShadows        EQU        'rcsh'
  685. kQ3StyleTypeHighlight            EQU        'high'
  686. kQ3StyleTypeSubdivision            EQU        'sbdv'
  687. kQ3StyleTypeOrientation            EQU        'ofdr'
  688. kQ3StyleTypePickParts            EQU        'pkpt'
  689. kQ3StyleTypeAntiAlias            EQU        'anti'
  690. kQ3ShapeTypeTransform            EQU        'xfrm'
  691. kQ3TransformTypeMatrix            EQU        'mtrx'
  692. kQ3TransformTypeScale            EQU        'scal'
  693. kQ3TransformTypeTranslate        EQU        'trns'
  694. kQ3TransformTypeRotate            EQU        'rott'
  695. kQ3TransformTypeRotateAboutPoint EQU    'rtap'
  696. kQ3TransformTypeRotateAboutAxis    EQU        'rtaa'
  697. kQ3TransformTypeQuaternion        EQU        'qtrn'
  698. kQ3TransformTypeReset            EQU        'rset'
  699. kQ3ShapeTypeLight                EQU        'lght'
  700. kQ3LightTypeAmbient                EQU        'ambn'
  701. kQ3LightTypeDirectional            EQU        'drct'
  702. kQ3LightTypePoint                EQU        'pntl'
  703. kQ3LightTypeSpot                EQU        'spot'
  704. kQ3ShapeTypeCamera                EQU        'cmra'
  705. kQ3CameraTypeOrthographic        EQU        'orth'
  706. kQ3CameraTypeViewPlane            EQU        'vwpl'
  707. kQ3CameraTypeViewAngleAspect    EQU        'vana'
  708. kQ3ShapeTypeGroup                EQU        'grup'
  709. kQ3GroupTypeDisplay                EQU        'dspg'
  710. kQ3DisplayGroupTypeOrdered        EQU        'ordg'
  711. kQ3DisplayGroupTypeIOProxy        EQU        'iopx'
  712. kQ3GroupTypeLight                EQU        'lghg'
  713. kQ3GroupTypeInfo                EQU        'info'
  714. kQ3ShapeTypeUnknown                EQU        'unkn'
  715. kQ3UnknownTypeText                EQU        'uktx'
  716. kQ3UnknownTypeBinary            EQU        'ukbn'
  717. kQ3ShapeTypeReference            EQU        'rfrn'
  718. kQ3ReferenceTypeExternal        EQU        'rfex'
  719. kQ3SharedTypeSet                EQU        'set '
  720. kQ3SetTypeAttribute                EQU        'attr'
  721. kQ3SharedTypeDrawContext        EQU        'dctx'
  722. kQ3DrawContextTypePixmap        EQU        'dpxp'
  723. kQ3DrawContextTypeMacintosh        EQU        'dmac'
  724. kQ3DrawContextTypeWin32DC        EQU        'dw32'
  725. kQ3DrawContextTypeDDSurface        EQU        'ddds'
  726. kQ3DrawContextTypeX11            EQU        'dx11'
  727. kQ3SharedTypeTexture            EQU        'txtr'
  728. kQ3TextureTypePixmap            EQU        'txpm'
  729. kQ3SharedTypeFile                EQU        'file'
  730. kQ3SharedTypeStorage            EQU        'strg'
  731. kQ3StorageTypeMemory            EQU        'mems'
  732. kQ3MemoryStorageTypeHandle        EQU        'hndl'
  733. kQ3StorageTypeUnix                EQU        'uxst'
  734. kQ3UnixStorageTypePath            EQU        'unix'
  735. kQ3StorageTypeMacintosh            EQU        'macn'
  736. kQ3MacintoshStorageTypeFSSpec    EQU        'macp'
  737. kQ3StorageTypeWin32                EQU        'wist'
  738. kQ3SharedTypeString                EQU        'strn'
  739. kQ3StringTypeCString            EQU        'strc'
  740. kQ3SharedTypeShapePart            EQU        'sprt'
  741. kQ3ShapePartTypeMeshPart        EQU        'spmh'
  742. kQ3MeshPartTypeMeshFacePart        EQU        'mfac'
  743. kQ3MeshPartTypeMeshEdgePart        EQU        'medg'
  744. kQ3MeshPartTypeMeshVertexPart    EQU        'mvtx'
  745. kQ3SharedTypeControllerState    EQU        'ctst'
  746. kQ3SharedTypeTracker            EQU        'trkr'
  747. kQ3SharedTypeViewHints            EQU        'vwhn'
  748. kQ3SharedTypeEndGroup            EQU        'endg'
  749. kQ3ObjectTypeEndGroup            EQU        'endg'
  750. ; ******************************************************************************
  751. ; **                                                                             **
  752. ; **                            QuickDraw 3D System Routines                     **
  753. ; **                                                                             **
  754. ; ****************************************************************************
  755.  
  756. ;
  757. ; extern TQ3Status Q3Initialize(void )
  758. ;
  759.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  760.         IMPORT_CFM_FUNCTION Q3Initialize
  761.     ENDIF
  762.  
  763. ;
  764. ; extern TQ3Status Q3Exit(void )
  765. ;
  766.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  767.         IMPORT_CFM_FUNCTION Q3Exit
  768.     ENDIF
  769.  
  770. ;
  771. ; extern TQ3Boolean Q3IsInitialized(void )
  772. ;
  773.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  774.         IMPORT_CFM_FUNCTION Q3IsInitialized
  775.     ENDIF
  776.  
  777. ;
  778. ; extern TQ3Status Q3GetVersion(unsigned long *majorRevision, unsigned long *minorRevision)
  779. ;
  780.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  781.         IMPORT_CFM_FUNCTION Q3GetVersion
  782.     ENDIF
  783.  
  784. ; *  Q3GetReleaseVersion returns the release version number,
  785. ; *  in the format of the first four bytes of a 'vers' resource
  786. ; *  (e.g. 0x01518000 ==> 1.5.1 release).
  787.  
  788. ;
  789. ; extern TQ3Status Q3GetReleaseVersion(unsigned long *releaseRevision)
  790. ;
  791.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  792.         IMPORT_CFM_FUNCTION Q3GetReleaseVersion
  793.     ENDIF
  794.  
  795.  
  796. ; ******************************************************************************
  797. ; **                                                                             **
  798. ; **                            ObjectClass Routines                             **
  799. ; **                                                                             **
  800. ; ****************************************************************************
  801.  
  802. ; *  Q3ObjectClass_Unregister is an obsolete function.  For the new extensions 
  803. ; *  model you should now use Q3XObjectHierarchy_UnregisterClass which is 
  804. ; *  defined in QD3DExtension.h and takes identical parameters.
  805.  
  806. ;
  807. ; extern TQ3Status Q3ObjectClass_Unregister(TQ3ObjectClass objectClass)
  808. ;
  809.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  810.         IMPORT_CFM_FUNCTION Q3ObjectClass_Unregister
  811.     ENDIF
  812.  
  813.  
  814. ;  
  815. ; *  New object system calls to query the object system.
  816. ; *
  817. ; *  These comments to move to the stubs file before final release, they 
  818. ; *  are here for documentation for developers using early seeds.
  819.  
  820. ; *  Given a class name as a string return the associated class type for the 
  821. ; *  class, may return kQ3Failure if the string representing the class is 
  822. ; *  invalid.
  823.  
  824. ;
  825. ; extern TQ3Status Q3ObjectHierarchy_GetTypeFromString(TQ3ObjectClassNameString objectClassString, TQ3ObjectType *objectClassType)
  826. ;
  827.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  828.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_GetTypeFromString
  829.     ENDIF
  830.  
  831. ; *  Given a class type as return the associated string for the class name, 
  832. ; *  may return kQ3Failure if the type representing the class is invalid.
  833.  
  834. ;
  835. ; extern TQ3Status Q3ObjectHierarchy_GetStringFromType(TQ3ObjectType objectClassType, TQ3ObjectClassNameString objectClassString)
  836. ;
  837.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  838.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_GetStringFromType
  839.     ENDIF
  840.  
  841. ;  
  842. ; *  Return true if the class with this type is registered, false if not 
  843.  
  844. ;
  845. ; extern TQ3Boolean Q3ObjectHierarchy_IsTypeRegistered(TQ3ObjectType objectClassType)
  846. ;
  847.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  848.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_IsTypeRegistered
  849.     ENDIF
  850.  
  851. ;  
  852. ; *  Return true if the class with this name is registered, false if not 
  853.  
  854. ;
  855. ; extern TQ3Boolean Q3ObjectHierarchy_IsNameRegistered(const char *objectClassName)
  856. ;
  857.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  858.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_IsNameRegistered
  859.     ENDIF
  860.  
  861. ; * TQ3SubClassData is used when querying the object system for
  862. ; * the subclasses of a particular parent type:
  863.  
  864. TQ3SubClassData            RECORD 0
  865. numClasses                 ds.l    1                ; offset: $0 (0)        ;  the # of subclass types found for a parent class 
  866. classTypes                 ds.l    1                ; offset: $4 (4)        ;  an array containing the class types 
  867. sizeof                     EQU *                    ; size:   $8 (8)
  868.                         ENDR
  869. ; *  Given a parent type and an instance of the TQ3SubClassData struct fill
  870. ; *  it in with the number and class types of all of the subclasses immediately
  871. ; *  below the parent in the class hierarchy.  Return kQ3Success to indicate no
  872. ; *  errors occurred, else kQ3Failure.
  873. ; *
  874. ; *  NOTE:  This function will allocate memory for the classTypes array.  Be 
  875. ; *    sure to call Q3ObjectClass_EmptySubClassData to free this memory up.
  876.  
  877. ;
  878. ; extern TQ3Status Q3ObjectHierarchy_GetSubClassData(TQ3ObjectType objectClassType, TQ3SubClassData *subClassData)
  879. ;
  880.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  881.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_GetSubClassData
  882.     ENDIF
  883.  
  884. ; *  Given an instance of the TQ3SubClassData struct free all memory allocated 
  885. ; *    by the Q3ObjectClass_GetSubClassData call.
  886. ; *
  887. ; *  NOTE: This call MUST be made after a call to Q3ObjectClass_GetSubClassData
  888. ; *  to avoid memory leaks.
  889.  
  890. ;
  891. ; extern TQ3Status Q3ObjectHierarchy_EmptySubClassData(TQ3SubClassData *subClassData)
  892. ;
  893.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  894.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_EmptySubClassData
  895.     ENDIF
  896.  
  897.  
  898. ; ******************************************************************************
  899. ; **                                                                             **
  900. ; **                                Object Routines                                 **
  901. ; **                                                                             **
  902. ; ****************************************************************************
  903.  
  904. ;
  905. ; extern TQ3Status Q3Object_Dispose(TQ3Object object)
  906. ;
  907.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  908.         IMPORT_CFM_FUNCTION Q3Object_Dispose
  909.     ENDIF
  910.  
  911. ;
  912. ; extern TQ3Object Q3Object_Duplicate(TQ3Object object)
  913. ;
  914.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  915.         IMPORT_CFM_FUNCTION Q3Object_Duplicate
  916.     ENDIF
  917.  
  918. ;
  919. ; extern TQ3Status Q3Object_Submit(TQ3Object object, TQ3ViewObject view)
  920. ;
  921.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  922.         IMPORT_CFM_FUNCTION Q3Object_Submit
  923.     ENDIF
  924.  
  925. ;
  926. ; extern TQ3Boolean Q3Object_IsDrawable(TQ3Object object)
  927. ;
  928.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  929.         IMPORT_CFM_FUNCTION Q3Object_IsDrawable
  930.     ENDIF
  931.  
  932. ;
  933. ; extern TQ3Boolean Q3Object_IsWritable(TQ3Object object, TQ3FileObject theFile)
  934. ;
  935.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  936.         IMPORT_CFM_FUNCTION Q3Object_IsWritable
  937.     ENDIF
  938.  
  939.  
  940. ; ******************************************************************************
  941. ; **                                                                             **
  942. ; **                            Object Type Routines                             **
  943. ; **                                                                             **
  944. ; ****************************************************************************
  945.  
  946. ;
  947. ; extern TQ3ObjectType Q3Object_GetType(TQ3Object object)
  948. ;
  949.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  950.         IMPORT_CFM_FUNCTION Q3Object_GetType
  951.     ENDIF
  952.  
  953. ;
  954. ; extern TQ3ObjectType Q3Object_GetLeafType(TQ3Object object)
  955. ;
  956.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  957.         IMPORT_CFM_FUNCTION Q3Object_GetLeafType
  958.     ENDIF
  959.  
  960. ;
  961. ; extern TQ3Boolean Q3Object_IsType(TQ3Object object, TQ3ObjectType theType)
  962. ;
  963.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  964.         IMPORT_CFM_FUNCTION Q3Object_IsType
  965.     ENDIF
  966.  
  967.  
  968. ; ******************************************************************************
  969. ; **                                                                             **
  970. ; **                            Shared Object Routines                             **
  971. ; **                                                                             **
  972. ; ****************************************************************************
  973.  
  974. ;
  975. ; extern TQ3ObjectType Q3Shared_GetType(TQ3SharedObject sharedObject)
  976. ;
  977.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  978.         IMPORT_CFM_FUNCTION Q3Shared_GetType
  979.     ENDIF
  980.  
  981. ;
  982. ; extern TQ3SharedObject Q3Shared_GetReference(TQ3SharedObject sharedObject)
  983. ;
  984.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  985.         IMPORT_CFM_FUNCTION Q3Shared_GetReference
  986.     ENDIF
  987.  
  988. ;  
  989. ; *    Q3Shared_IsReferenced
  990. ; *        Returns kQ3True if there is more than one reference to sharedObject.
  991. ; *        Returns kQ3False if there is ONE reference to sharedObject.
  992. ; *    
  993. ; *    This call is intended to allow applications and plug-in objects to delete
  994. ; *    objects of which they hold THE ONLY REFERENCE. This is useful when
  995. ; *    caching objects, etc.
  996. ; *    
  997. ; *    Although many may be tempted, DO NOT DO THIS:
  998. ; *        while (Q3Shared_IsReferenced(foo)) { Q3Object_Dispose(foo); }
  999. ; *    
  1000. ; *    Your application will crash and no one will buy it. Chapter 11 is 
  1001. ; *    never fun (unless you short the stock). Thanks.
  1002.  
  1003. ;
  1004. ; extern TQ3Boolean Q3Shared_IsReferenced(TQ3SharedObject sharedObject)
  1005. ;
  1006.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1007.         IMPORT_CFM_FUNCTION Q3Shared_IsReferenced
  1008.     ENDIF
  1009.  
  1010. ; *    Q3Shared_GetEditIndex
  1011. ; *        Returns the "serial number" of sharedObject. Usefuly for caching 
  1012. ; *        object information. Returns 0 on error.
  1013. ; *        
  1014. ; *        Hold onto this number to determine if an object has changed since you
  1015. ; *        last built your caches... To validate, do:
  1016. ; *        
  1017. ; *        if (Q3Shared_GetEditIndex(foo) == oldFooEditIndex) {
  1018. ; *            // Cache is valid
  1019. ; *        } else {
  1020. ; *            // Cache is invalid
  1021. ; *            RebuildSomeSortOfCache(foo);
  1022. ; *            oldFooEditIndex = Q3Shared_GetEditIndex(foo);
  1023. ; *        }
  1024.  
  1025. ;
  1026. ; extern unsigned long Q3Shared_GetEditIndex(TQ3SharedObject sharedObject)
  1027. ;
  1028.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1029.         IMPORT_CFM_FUNCTION Q3Shared_GetEditIndex
  1030.     ENDIF
  1031.  
  1032. ; *    Q3Shared_Edited
  1033. ; *        Bumps the "serial number" of sharedObject to a different value. This
  1034. ; *        call is intended to be used solely from a plug-in object which is 
  1035. ; *        shared. Call this whenever your private instance data changes.
  1036. ; *        
  1037. ; *        Returns kQ3Failure iff sharedObject is not a shared object, OR
  1038. ; *            QuickDraw 3D isn't initialized.
  1039.  
  1040. ;
  1041. ; extern TQ3Status Q3Shared_Edited(TQ3SharedObject sharedObject)
  1042. ;
  1043.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1044.         IMPORT_CFM_FUNCTION Q3Shared_Edited
  1045.     ENDIF
  1046.  
  1047.  
  1048. ; ******************************************************************************
  1049. ; **                                                                             **
  1050. ; **                                Shape Routines                                 **
  1051. ; **                                                                             **
  1052. ; ****************************************************************************
  1053.  
  1054. ; *    QuickDraw 3D 1.1 Note:
  1055. ; *
  1056. ; *    Shapes and Sets are now (sort of) polymorphic.
  1057. ; *
  1058. ; *        You may call Q3Shape_Foo or Q3Set_Foo on a shape or a set.
  1059. ; *        The following calls are identical, in implementation:
  1060. ; *
  1061. ; *            Q3Shape_GetElement            =    Q3Set_Get
  1062. ; *            Q3Shape_AddElement            =    Q3Set_Add
  1063. ; *            Q3Shape_ContainsElement        =    Q3Set_Contains
  1064. ; *            Q3Shape_GetNextElementType    =    Q3Set_GetNextElementType
  1065. ; *            Q3Shape_EmptyElements        =    Q3Set_Empty
  1066. ; *            Q3Shape_ClearElement        =    Q3Set_Clear
  1067. ; *
  1068. ; *    All of these calls accept a shape or a set as their first parameter.
  1069. ; *
  1070. ; *    The Q3Shape_GetSet and Q3ShapeSetSet calls are implemented via a new
  1071. ; *    element type kQ3ElementTypeSet. See the note above about 
  1072. ; *    kQ3ElementTypeSet;
  1073. ; *
  1074. ; *    It is important to note that the new Q3Shape_...Element... calls do not
  1075. ; *    create a set on a shape and then add the element to it. This data is
  1076. ; *    attached directly to the shape. Therefore, it is possible for an element
  1077. ; *    to exist on a shape without a set existing on it as well. 
  1078. ; *
  1079. ; *    In your application, if you attach an element to a shape like this:
  1080. ; *        (this isn't checking for errors for simplicity)
  1081. ; *
  1082. ; *        set = Q3Set_New();
  1083. ; *        Q3Set_AddElement(set, kMyElemType, &data);
  1084. ; *        Q3Shape_SetSet(shape, set);
  1085. ; *
  1086. ; *    You should retrieve it in the same manner:
  1087. ; *
  1088. ; *        Q3Shape_GetSet(shape, &set);
  1089. ; *        if (Q3Set_Contains(set, kMyElemType) == kTrue) {
  1090. ; *            Q3Set_Get(set, kMyElemType, &data);
  1091. ; *        }
  1092. ; *
  1093. ; *    Similarly, if you attach data to a shape with the new calls:
  1094. ; *
  1095. ; *        Q3Shape_AddElement(shape, kMyElemType, &data);
  1096. ; *
  1097. ; *    You should retrieve it in the same manner:
  1098. ; *
  1099. ; *        if (Q3Shape_ContainsElement(set, kMyElemType) == kTrue) {
  1100. ; *            Q3Shape_GetElement(set, kMyElemType, &data);
  1101. ; *        }
  1102. ; *
  1103. ; *    This really becomes an issue when dealing with version 1.0 and version 1.1 
  1104. ; *    metafiles.
  1105. ; *
  1106. ; *    When attempting to find a particular element on a shape, you should
  1107. ; *    first check with Q3Shape_GetNextElementType or Q3Shape_GetElement, then,
  1108. ; *    Q3Shape_GetSet(s, &set) (or Q3Shape_GetElement(s, kQ3ElementTypeSet, &set))
  1109. ; *    and then Q3Shape_GetElement(set, ...).
  1110. ; *
  1111. ; *    In terms of implementation, Q3Shape_SetSet and Q3Shape_GetSet should only be
  1112. ; *    used for sets of information that are shared among multiple shapes.
  1113. ; *    
  1114. ; *    Q3Shape_AddElement, Q3Shape_GetElement, etc. calls should only be used
  1115. ; *    for elements that are unique for a particular shape.
  1116. ; *    
  1117.  
  1118. ;
  1119. ; extern TQ3ObjectType Q3Shape_GetType(TQ3ShapeObject shape)
  1120. ;
  1121.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1122.         IMPORT_CFM_FUNCTION Q3Shape_GetType
  1123.     ENDIF
  1124.  
  1125. ;
  1126. ; extern TQ3Status Q3Shape_GetSet(TQ3ShapeObject shape, TQ3SetObject *theSet)
  1127. ;
  1128.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1129.         IMPORT_CFM_FUNCTION Q3Shape_GetSet
  1130.     ENDIF
  1131.  
  1132. ;
  1133. ; extern TQ3Status Q3Shape_SetSet(TQ3ShapeObject shape, TQ3SetObject theSet)
  1134. ;
  1135.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1136.         IMPORT_CFM_FUNCTION Q3Shape_SetSet
  1137.     ENDIF
  1138.  
  1139. ;
  1140. ; extern TQ3Status Q3Shape_AddElement(TQ3ShapeObject shape, TQ3ElementType theType, const void *data)
  1141. ;
  1142.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1143.         IMPORT_CFM_FUNCTION Q3Shape_AddElement
  1144.     ENDIF
  1145.  
  1146. ;
  1147. ; extern TQ3Status Q3Shape_GetElement(TQ3ShapeObject shape, TQ3ElementType theType, void *data)
  1148. ;
  1149.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1150.         IMPORT_CFM_FUNCTION Q3Shape_GetElement
  1151.     ENDIF
  1152.  
  1153. ;
  1154. ; extern TQ3Boolean Q3Shape_ContainsElement(TQ3ShapeObject shape, TQ3ElementType theType)
  1155. ;
  1156.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1157.         IMPORT_CFM_FUNCTION Q3Shape_ContainsElement
  1158.     ENDIF
  1159.  
  1160. ;
  1161. ; extern TQ3Status Q3Shape_GetNextElementType(TQ3ShapeObject shape, TQ3ElementType *theType)
  1162. ;
  1163.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1164.         IMPORT_CFM_FUNCTION Q3Shape_GetNextElementType
  1165.     ENDIF
  1166.  
  1167. ;
  1168. ; extern TQ3Status Q3Shape_EmptyElements(TQ3ShapeObject shape)
  1169. ;
  1170.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1171.         IMPORT_CFM_FUNCTION Q3Shape_EmptyElements
  1172.     ENDIF
  1173.  
  1174. ;
  1175. ; extern TQ3Status Q3Shape_ClearElement(TQ3ShapeObject shape, TQ3ElementType theType)
  1176. ;
  1177.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1178.         IMPORT_CFM_FUNCTION Q3Shape_ClearElement
  1179.     ENDIF
  1180.  
  1181.  
  1182.     ENDIF ; __QD3D__ 
  1183.  
  1184.